package nci60.data.protein.uniprot

/**
 * If the protein is cleaved into multiple functional components, each component is stored here with its full name.
 *
 * @autor <a href="mailto:Florian.J.Auer@googlemail.com">Florian J. Auer</a>
*/
class UniprotContain {

    /**
    * Full name of the functional component
    */
    String fullName

    
    /**
    * GRAILS <a href="http://grails.org/doc/latest/guide/GORM.html#gormAssociation" target="_blank">Associations in Gorm</a>
    * <p />
    * <style>.custom-table td{border-top:1pt solid grey;vertical-align:top;} .custom-table{border-collapse:collapse;width:100%;}</style>
    * <table class="custom-table">
    * <tr><td>
    *              parent
    * </td><td>        belongs to one specific Protein entry from Uniprot <p />
    *                  <b>See Also:</b> {@link nci60.data.protein.uniprot.Uniprot}
    * </td></tr>
    * </table>
    */
    static belongsTo = [parent:Uniprot]

    
    /**
     * GRAILS <a href="http://grails.org/doc/latest/guide/GORM.html#gormAssociation" target="_blank">Associations in Gorm</a>
     * <p />
     * <style>.custom-table td{border-top:1pt solid grey;vertical-align:top;} .custom-table{border-collapse:collapse;width:100%;}</style>
     * <table class="custom-table">
     * <tr><td>
     *              shortNames
     * </td><td>        short name of the protein entry <p />
     *                  <b>See Also:</b> {@link nci60.data.protein.uniprot.UniprotShortName} <p />
     *                  The relationship has a customized mapping as jointable "uniprotContain_has_shortnames"<p />
     *                  <b>See Also:</b> {@link #mapping}
     * </td></tr>
     * <tr><td>
     *              ecs
     * </td><td>        enzyme class entries <p />
     *                  <b>See Also:</b> {@link nci60.data.protein.uniprot.UniprotEC} <p />
     *                  The relationship has a customized mapping as jointable "uniprotContain_has_ecs"<p />
     *                  <b>See Also:</b> {@link #mapping}
     * </td></tr>
     * <tr><td>
     *              altNames
     * </td><td>        alternative protein names <p />
     *                  <b>See Also:</b> {@link nci60.data.protein.uniprot.UniprotAltName} <p />
     *                  The relationship has a customized mapping as jointable "uniprotContain_has_altnames"<p />
     *                  <b>See Also:</b> {@link #mapping}
     * </td></tr>
     * </table>
     */	
    static hasMany = [shortNames:UniprotShortName,
                        ecs:UniprotEC,
                        altNames:UniprotAltName]


    /**
     * GRAILS <a href="http://grails.org/doc/latest/guide/single.html#constraints" target="_blank">Declaring Constraints</a>
     * <p />
     * Constraints in Grails are a way to declaratively specify validation rules for generating objects in GORM.
     */	
    static constraints = {
    }

    /**
     * GRAILS <a href="http://grails.org/doc/latest/guide/GORM.html#ormdsl" target="_blank">Custom ORM Mapping</a>
     * <p />
     * Grails domain classes can be mapped onto many legacy schemas with an Object Relational Mapping DSL (domain specific language). 
     */	
    static mapping = {
        version : false
        shortNames joinTable : 'uniprotContain_has_shortnames'
        ecs joinTable : 'uniprotContain_has_ecs'
        altNames joinTable : 'uniprotContain_has_altnames'
    }

    /**
     * GRAILS default representation of the object as String
     * @return String representation of the object
     */	
    String toString(){
        return 'Contain:'+fullName+', parent:'+parent.id+', short:'+shortNames+', altNames:'+altNames
    }
}
